package com.wkg.music_player.mapper;

import com.wkg.music_player.model.Music;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface LoveMusicMapper {

    // 检查是否已经收藏过该⾳乐
    Music findLoveMusicByMusicIdAndUserId(int userId, int musicId);

    //点赞/收藏⾳乐
    Boolean insertLoveMusic(int userId, int musicId);

    //查询当前用户喜欢的音乐
    List<Music> findLoveMusicByUserId(int userId);

    //根据某个⽤⼾的ID和歌曲名称查询，某个⽤⼾收藏的⾳乐
    List<Music> findLoveMusicBykeyAndUID(String musicName, int userId);

    //删除某个用户喜欢的音乐
    int deleteLoveMusic(int userId, int musicId);

    //根据音乐ID进行删除
    int deleteLoveMusicByMusicId(int musicId);
}
